#include<iostream>
using namespace std;
#include<vector>
#include<algorithm>
class Solution {
public:
    int maxConsecutive(int bottom, int top, vector<int>& special) {
        sort(special.begin(), special.end());
        int start = bottom, end = special[0], now = 0, ans = 0;
        while (start < top) {
            if (now < special.size())
                end = special[now++];
            else
                end = top + 1;
            ans = max(ans, end - start);
            start = end + 1;
        }
        return ans;
    }
};